//
//  yxpFontSelectionVC.m
//  TestProject
//
//  Created by 杨小平 on 14-8-30.
//  Copyright (c) 2014年 yangxiaoping. All rights reserved.
//

#import "yxpFontSelectionVC.h"
#import "FontSelectCell.h"

@interface yxpFontSelectionVC ()
{
    NSArray *_fontNameArray;
}

@end

@implementation yxpFontSelectionVC

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
	
    _fontNameArray=[UIFont familyNames];
}

#pragma mark -- UITableViewControllerDelegate，UITableViewControllerDataSoruce
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return _fontNameArray.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *acell=@"acell";
    FontSelectCell *cell=[tableView dequeueReusableCellWithIdentifier:acell];
    if (!cell) {
        cell=[[FontSelectCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:acell];
    }
    
    cell.StyleName.text=_fontNameArray[indexPath.row];
    cell.StyleName.textColor=[UIColor skyGreenColor];
    
    cell.Chinese.text=@"字体 样式";
    cell.Chinese.font=[UIFont fontWithName:_fontNameArray[indexPath.row] size:20.0f];
    cell.Chinese.textColor=[UIColor purpleColor];
    
    cell.English.text=@"Font Style";
    cell.English.font=[UIFont fontWithName:_fontNameArray[indexPath.row] size:20.0f];
    cell.English.textColor=[UIColor skyBlueColor];
    
    return cell;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return CELL_HEIGHT;
}
- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
